home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000019_icon-group-sender _Wed Jan 17 06:31:40 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Wed, 17 Jan 1996 08:43:24 MST
Date: Wed, 17 Jan 1996 06:31:40 -0600 (CST)
From: "Chris D. Tenaglia" <cdt@post.its.mcw.edu>
To: Hamish Lawson <H.Lawson@tees.ac.uk>
Cc: icon-group@cs.arizona.edu
Subject: Re: Initialising tables
In-Reply-To: <4B78DE79AC@scm_arkengarthdale.tees.ac.uk>
Message-Id: <Pine.ULT.3.90.960117062302.15155A-100000@post.its.mcw.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
I do it two ways depending on whether the initials are
constants or may change. If they are constants I actually do:
contbl := table("n/a")
contbl["xx-xx-xx"] := "###=#+##"
contbl["xx-xxx-x"] := "##+###++"
contbl["xxx-x-xx"] := "##-=##_#"
...
If the case of configurable tables I put them in a file, perhaps
referenced by an environmental variable.
confile := getenv("CONFTAB") | ".conftab"
(in := open(confile)) | stop("Missing ",confile)
conftab := table("n/a")
every line := !in do
conftab[parse(line,' \t')[1]] := parse(line,' \t')[2]
close(in)
Chris Tenaglia (system manager) | cdt@post.its.mcw.edu
Medical College of Wisconsin |
8701 W. Watertown Plank Rd. | Ce que vous voyez est
Milwaukee, WI 53226 (414)456-8765 | ce que vous obtenez !
On Sat, 13 Jan 1996, Hamish Lawson wrote:
> Date: Sat, 13 Jan 1996 14:58:33 GMT0BST
> From: Hamish Lawson <H.Lawson@tees.ac.uk>
> To: icon-group@cs.arizona.edu
> Subject: Initialising tables
>
> Is there an quick way to initialise tables, along the lines of the
> list assignment below?
>
> aList := ["this","list","is","a","list"]
>
> I've cooked up the following, but is there a more concise way?
>
> aTable := table()
> every entry := ![["bob",2],["sue",5],["fred",12],["mary",9]] do
> aTable[entry[1]] := entry[2]
>
> | Hamish Lawson, School of Computing and Mathematics,
> | University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA
> | Tel: +44 1642 218121 x3611 Fax: +44 1642 342604
> | E-mail: H.Lawson@tees.ac.uk
>